import axiosInstance from "../axiosInstance";

const addressInfo = {
    //添加地址
    addAddress({
        phone, address, person_name, tag
    }) {
        return axiosInstance.post(
            "/addressInfo/addAddress", {
            phone, address, person_name, tag
        }

        )
    },
    //查询地址
    getAddressInfoList() {
        return axiosInstance.get(
            "/addressInfo/getMyAddressInfoList"
        )
    },
    //删除地址
    deleteById(id) {
        return axiosInstance.get(
            "/addressInfo/deleteById", {
            params: { id }
        }
        )
    },
    //根据id获取详细地址
    findById(id) {
        return axiosInstance.get("/addressInfo/findById", {
            params: { id }
        }
        )
    },
    //修改地址
    update({
        id, phone, address, person_name, tag
    }) {
        return axiosInstance.post(
            "/addressInfo/update", {
            id, phone, address, person_name, tag
        }
        )
    }

}

export default addressInfo